package com.pearadmin.pro.modules.stu.service.impl;

import java.util.List;
import java.util.ArrayList;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pearadmin.pro.common.web.base.page.PageResponse;
import com.pearadmin.pro.common.web.base.page.Pageable;

import com.pearadmin.pro.modules.stu.domain.StuOrderCourse;
import com.pearadmin.pro.modules.stu.param.StuOrderCourseRequest;
import com.pearadmin.pro.modules.stu.repository.StuOrderCourseRepository;
import com.pearadmin.pro.modules.stu.service.StuOrderCourseService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;


/**
 * 学生订单签单课程信息Service业务层处理
 *
 * @author chenJian
 * @date 2021-09-09
 */
@Service
public class StuOrderCourseServiceImpl extends ServiceImpl<StuOrderCourseRepository, StuOrderCourse> implements StuOrderCourseService
{
    @Resource
    private StuOrderCourseRepository stuOrderCourseRepository;

    /**
     * 查询学生订单签单课程信息
     * @param request
     * @return 学生订单签单课程信息 分页集合
     * */
    @Override
    public PageResponse<StuOrderCourse> page(StuOrderCourseRequest request)
    {
        LambdaQueryWrapper<StuOrderCourse> query = new LambdaQueryWrapper<StuOrderCourse>();
        return Pageable.of(request,(()->  stuOrderCourseRepository.selectList(query)));
    }

    /**
     * 查询学生订单签单课程信息
     *
     * @param id 学生订单签单课程信息ID
     * @return 学生订单签单课程信息
     */
    @Override
    public StuOrderCourse selectStuOrderCourseById(Long id)
    {
        return stuOrderCourseRepository.selectById(id);
    }

}
